//
//  DKAuthHomeHeadCell.m
//  DanKU
//
//  Created by 吴斌 on 2023/11/9.
//

#import "DKAuthHomeHeadCell.h"
#import "DKHomeHeadAuthorizedView.h"
static NSString * DKAuthHomeHeadCellId = @"DKAuthHomeHeadCellId";
@interface DKAuthHomeHeadCell()
@property (nonatomic, strong)DKHomeHeadAuthorizedView * dk_HomeHeadAuthorizedView;
@end
@implementation DKAuthHomeHeadCell
+ (instancetype)authHomeHeadCell:(UITableView *)tableView{
    DKAuthHomeHeadCell * dk_AuthHomeHeadCell = [tableView dequeueReusableCellWithIdentifier:DKAuthHomeHeadCellId];
    if (!dk_AuthHomeHeadCell) {
        dk_AuthHomeHeadCell = [[DKAuthHomeHeadCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:DKAuthHomeHeadCellId];
    }
    dk_AuthHomeHeadCell.backgroundColor = [UIColor clearColor];
    dk_AuthHomeHeadCell.selectionStyle = UITableViewCellSelectionStyleNone;
    dk_AuthHomeHeadCell.accessoryType = UITableViewCellAccessoryNone;
    return dk_AuthHomeHeadCell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    WeakSelf(self)
    self.dk_HomeHeadAuthorizedView = [[DKHomeHeadAuthorizedView alloc] init];
    [self.contentView addSubview:self.dk_HomeHeadAuthorizedView];
    [self.dk_HomeHeadAuthorizedView  mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(0)));
        make.right.equalTo(@(-DK_IsWidthScale(0)));
        make.top.equalTo(@(-DK_IsWidthScale(0)));
        make.bottom.equalTo(@(DK_IsWidthScale(0)));
    }];
    self.dk_HomeHeadAuthorizedView.HomeTranFailBlock = ^{
        if(weakSelf.HomeTranFailBlock){
            weakSelf.HomeTranFailBlock();
        }
    };
}
-(void)setDk_UserLoanStatusMdl:(DKUserLoanStatusModel *)dk_UserLoanStatusMdl{
    _dk_UserLoanStatusMdl = dk_UserLoanStatusMdl;
    self.dk_HomeHeadAuthorizedView.dk_UserLoanStatusMdl = dk_UserLoanStatusMdl;
}
- (void)updataHomeHeadData{
    [self.dk_HomeHeadAuthorizedView updataHomeHeadData];
}
@end
